﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web;
using System.Web.Mvc;

namespace Model
{

    [MetadataType(typeof(SellBack_Metadata))]
    [DisplayName("退货单管理")]
    public partial class SellBack
    {
        public SellBack()
        {
            this.Id = Guid.NewGuid();
            this.AddDate = DateTime.Now;
            this.Number = "THD" + "-" + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString() + "-" + DateTime.Now.Hour.ToString() + DateTime.Now.Minute.ToString() + DateTime.Now.Second.ToString();
            this.UserId = new Guid(HttpContext.Current.User.Identity.Name);
        }

        public class SellBack_Metadata
        {
            [ScaffoldColumn(false)]
            public Guid Id { get; set; }

            [ScaffoldColumn(false)]
            public Guid UserId { get; set; }

            [DisplayName("退货单编号")]
            public object Number { get; set; }

            [DisplayName("合同单编号")]
            [DropDownList("ContactOrder", "Id", "Number")]
            public object ContactOrderId { get; set; }

            [DisplayName("客户")]
            [DropDownList("Customer", "Id", "CustomerName")]
            public object CustomerId { get; set; }


            [DisplayName("退货日期")]
            
            public object BackDate { get; set; }

            [DisplayName("审批状态")]
            [DropDownList("VerifyState", "Id", "State")]
            public object StateId { get; set; }

            [DisplayName("备注")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            [DataType(DataType.MultilineText)]
            public object Description { get; set; }

            [DisplayName("负 责 人")]
            [DropDownList("Sys_Users", "Id", "UserName")]
            public object AdminId { get; set; }

            [DisplayName("添加日期")]
            [ScaffoldColumn(false)]
            [DataType(DataType.DateTime)]
            public object AddDate { get; set; }

            //[DisplayName("标题")]
            //[Required]
            //public object Title { get; set; }



        }
    }
}
